package top.rushpeak.edu03.admin.filter;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;


public class AdminAuthInterceptor implements Interceptor {

	public void intercept(Invocation inv) {
//		Controller controller = inv.getController();
//		String userId = (String)controller.getSessionAttr("lvheuser");
//		String sessionId = (String)controller.getSessionAttr("lvheauth");
//		boolean key = false;
//		//后面加缓存
//		if(sessionId!=null){
//			MadminAuthUser user = MadminAuthUser.dao.findFirst("SELECT * FROM `madmin_auth_user` WHERE `username`='"+userId+"' AND `role_ids`='"+sessionId+"'");
//			if(user!=null){
//				key=true;
//				inv.invoke();				
//			}
//		}
//		if(!key){
//			controller.redirect("/index/login");			
//		}
		
	}

}
